﻿using UnityEngine;
using System.Collections;
using System;

/// <summary>
/// 游戏主控器
/// </summary>
public class GameMgr : Singleton<GameMgr>
{
    GameEngine _engine;

    public GameMgr()
    {
        if (_engine == null)
        {
            var go = new GameObject("Engine");
            _engine = go.AddComponent<GameEngine>();
            GameObject.DontDestroyOnLoad(go);
        }
    }

    internal void Init()
    {
        AudioMgr.instance.Init();

        UIManager.instance.Init();
        QuickCoroutine.instance.Init();
        Net.instance.Init();

        // 跳转到登录界面
        LevelMgr.instance.LoadLevel(1);
    }
}
